package langchain4j.hsl.com.agents;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * Created by hsl on 2025/4/25.
 */
@AiService(
        wiringMode = EXPLICIT,
        // chatMemory = "chatMemory",  存储在内存中
        chatModel = "qwenChatModel",
        chatMemoryProvider = "chatMemoryProvider",
        tools = "calculatorTools"  // 配置工具 tools
)
public interface SeparateChatAssistant {
    /**
     * 分离聊天记录
     *
     * @param memoryId    聊天id
     * @param userMessage 用户消息
     * @return
     */
    @SystemMessage(fromResource = "my-prompt-template.txt")
    // @SystemMessage("你是我的好朋友，请用东北话回答问题。每次回答完成后，添加时间{{current_date}}")  // 系统消息提示词
    String chat(@MemoryId Long memoryId, @UserMessage String userMessage);

    @UserMessage("你是我的好朋友，请用日语回答问题。{{message}}")
    String chat2(@MemoryId Long memoryId, @V("message") String userMessage);

    @SystemMessage(fromResource = "my-prompt-template3.txt")
    String chat3(@MemoryId Long memoryId,
                 @UserMessage String userMessage,
                 @V("username") String username,
                 @V("age") int age);
}
